<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
function login(){
	$.ajax({
		type:"POST",
		url:"https://dynamic.12306.cn/otsweb/loginAction.do?method=login",
		data:"user=nebula2012&pwd=yanKui1314&randCode="+$(randCode).val(),
		success:function(data){
			if(data.indexOf("，欢迎您!")!=-1){
				isLoginOk=true;window.open("https://dynamic.12306.cn/otsweb/order/querySingleAction.do?method=init","main")
			}else{
				if(!isLoginOk){
					login()
				}
				return false
			}
		}
		})
}

</script>
<body>
<input type="button" value="OK" onclick="login()">
</body>
</html>